<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/node_modules/layui/dist/css/layui.css">
    <link rel="stylesheet" href="/static/style1.css">
    <script src="/static/node_modules/layui/dist/layui.js"></script>
    <script src="/static/node_modules/jquery/dist/jquery.min.js">
    </script>
</head>

<body>
    <div class="layui-container">
        <div class="layui-row one">
            <div class="layui-col-md4 layui-col-md-offset4 content">
                请输入验证码：<br><input type="text"> <button onclick="tiJiao()">提交</button>
                <div class="abc"><img src="{:captcha_src()}" alt="captcha" onclick="change(this)" /></div>
            </div>
        </div>
    </div>
</body>
<script>
    function change(abc) {
        abc.src = '{:captcha_src()}?' + Math.random();
    }

    function tiJiao() {

        $.post("total/verifyCode",
            {
                code: $("input").val()
            },
            function (data, status) {
                layer.msg(data.message);
                $('img').attr("src", "{:captcha_src()}?" + Math.random());
            });
    }
</script>

</html>